package com.fjut.zr.judge_system.POJO.PO;

import java.sql.Timestamp;
import java.util.Objects;

public class TUserAuthPO {
    private int id;
    private String username;
    private String salt;
    private String password;
    private Short attemptLoginFailCount;
    private Short locked;
    private Timestamp unlockTime;
    private Timestamp lastLoginTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Short getAttemptLoginFailCount() {
        return attemptLoginFailCount;
    }

    public void setAttemptLoginFailCount(Short attemptLoginFailCount) {
        this.attemptLoginFailCount = attemptLoginFailCount;
    }

    public Short getLocked() {
        return locked;
    }

    public void setLocked(Short locked) {
        this.locked = locked;
    }

    public Timestamp getUnlockTime() {
        return unlockTime;
    }

    public void setUnlockTime(Timestamp unlockTime) {
        this.unlockTime = unlockTime;
    }

    public Timestamp getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TUserAuthPO that = (TUserAuthPO) o;
        return id == that.id &&
                Objects.equals(username, that.username) &&
                Objects.equals(salt, that.salt) &&
                Objects.equals(password, that.password) &&
                Objects.equals(attemptLoginFailCount, that.attemptLoginFailCount) &&
                Objects.equals(locked, that.locked) &&
                Objects.equals(unlockTime, that.unlockTime) &&
                Objects.equals(lastLoginTime, that.lastLoginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, salt, password, attemptLoginFailCount, locked, unlockTime, lastLoginTime);
    }
}
